#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

void judge(char str[]);
int main()
{

	char str1[20] = { 0 };
	char str2[20] = { 0 };

	printf("please input:\n");
	scanf("%[^\n]s", str1);

	getchar();

	printf("please input:\n");
	scanf("%[^\n]s", str2);

	judge(str1);
	judge(str2);

	int n = strcmp(str1, str2);
	if (n == 0)
	{
		printf("%s\n", str1);
	}
	else
	{
		printf("%s", str1);
		printf("%s\n", str2);
	}

	return 0;
}

void judge(char str[])
{

	char* p = str;
	int len = strlen(str);
	for (int i = 1; i < len; i++)
	{
		if (str[i] % 2 == str[i - 1] % 2)
		{
			*p++ = str[i] > str[i - 1]
		             ? str[i] : str[i - 1];
		}
	}
	*p = '\0';
	//11341140
	//51672003
}